<template>
  <div class="wrap pt16-lr24">
    <!--v-if="materialId"  当materialId没有值时不调用接口，解决进入页面接口调两次问题-->
    <div v-if="materialId" class="list">
      <AutoList
        :params="{materialId}"
        :request="getMaterialFormList"
        :show-on-get-data="false"
        height="100vh"
        mb="160"
        @list="formData = $event"
      >
        <div v-for="(item, index) in formData" :key="index" class="form_list">
          <div class="form_part">
            <div class="flex_sb_cen">
              <div class="form_name">咨询人名称：</div>
              <div class="form_text">{{ item.name }}</div>
            </div>
            <div class="flex_sb_cen">
              <div class="form_name">手机号码：</div>
              <div class="form_text">{{ item.mobile }}</div>
            </div>
            <div class="flex_start">
              <div class="form_name">咨询问题：</div>
              <div class="form_text">{{ item.question }}</div>
            </div>
            <div class="flex_sb_cen">
              <div class="form_name">提交时间：</div>
              <div class="form_text">{{ item.commitTime }}</div>
            </div>
          </div>
          <div class="flex_end" style="margin-top: 26rpx;">
            <Button @confirm="goTel(item.mobile)">拨打电话</Button>
          </div>
        </div>
      </AutoList>
    </div>
  </div>
</template>
<script lang="ts" setup>
import Button from '@C/Button.vue'
import goTel from '@U/goTel'
import { onLoad } from '@U/common'
import { getMaterialFormList } from '@P_GL/ZhiKe/margetCenter/request'
import { ref } from 'vue'
import AutoList from '@C/AutoList.vue'

// 获取素材表单列表
const formData = ref([])
const materialId = ref('')
onLoad((options: any) => {
  materialId.value = options.materialId
})
</script>
<style lang="less" scoped>
</style>
